package xssys;

public class Testing {
    static final double rate=0.03;
    public static void main(String[] args) {
        Shiyanshi s1=new Shiyanshi("实验室1101");
        Shiyanshi s2=new Shiyanshi("实验室1102");
        Shiyanshi s3=new Shiyanshi("实验室1103");
        Shiyanshi s4=new Shiyanshi("实验室1104");
        Shiyanshi s5=new Shiyanshi("实验室1105");
        Shiyanshi s6=new Shiyanshi("实验室1106");

        Student liu=new Student("刘同学",new Shiyanshi[]{s1});
        Student zhao=new Student("赵同学",new Shiyanshi[]{s2,s3});
        Student ma=new Student("马同学",new Shiyanshi[]{s4,s5,s6});

        System.out.println("学生信息:");
        System.out.print("学生姓名:"+liu.name);
        System.out.print("\t负责实验室:");

        for(int i=0;i<liu.room.length;i++){
            System.out.print(liu.room[i].sysname+"\t");
        }

        System.out.print("\n学生姓名:"+zhao.name);
        System.out.print("\t负责实验室:");
        for(int i=0;i<zhao.room.length;i++){
            System.out.print(zhao.room[i].sysname+"\t");
        }

        System.out.print("\n学生姓名:"+ma.name);
        System.out.print("\t负责实验室:");
        for(int i=0;i<ma.room.length;i++){
            System.out.print(ma.room[i].sysname+"\t");
        }

        System.out.println("\n\n实验室等级评判:");
        s1.setRank(new String[]{"优秀","良好","优秀","优秀","及格","优秀","良好","优秀","及格","优秀","优秀","及格","优秀","优秀","优秀","优秀","优秀","良好"});
        s2.setRank(new String[]{"及格","优秀","优秀","及格","及格","优秀","良好","及格","优秀","优秀","及格","优秀","良好","良好","优秀","及格","优秀","优秀"});
        s3.setRank(new String[]{"良好","优秀","及格","优秀","及格","优秀","良好","及格","优秀","优秀","优秀","及格","优秀","良好","优秀","良好","优秀","及格"});
        s4.setRank(new String[]{"优秀","及格","优秀","良好","良好","优秀","及格","优秀","优秀","良好","优秀","及格","优秀","优秀","及格","优秀","及格","优秀"});
        s5.setRank(new String[]{"良好","优秀","及格","优秀","优秀","及格","优秀","优秀","及格","优秀","良好","优秀","及格","良好","优秀","优秀","优秀","良好"});
        s6.setRank(new String[]{"及格","优秀","良好","优秀","良好","及格","优秀","优秀","及格","优秀","优秀","及格","优秀","优秀","及格","优秀","良好","优秀"});

        liu.payoff1();
        zhao.payoff2();
        ma.payoff3();

        System.out.println(s1.sysname+":");
        for(int i=0;i<18;i++){
            System.out.print("第"+(i+1)+"周:"+s1.rank[i]+" ");
        }
        System.out.println("\n"+s2.sysname+":");
        for(int i=0;i<18;i++){
            System.out.print("第"+(i+1)+"周:"+s2.rank[i]+" ");
        }
        System.out.println("\n"+s3.sysname+":");
        for(int i=0;i<18;i++){
            System.out.print("第"+(i+1)+"周:"+s3.rank[i]+" ");
        }
        System.out.println("\n"+s4.sysname+":");
        for(int i=0;i<18;i++){
            System.out.print("第"+(i+1)+"周:"+s4.rank[i]+" ");
        }
        System.out.println("\n"+s5.sysname+":");
        for(int i=0;i<18;i++){
            System.out.print("第"+(i+1)+"周:"+s5.rank[i]+" ");
        }
        System.out.println("\n"+s6.sysname+":");
        for(int i=0;i<18;i++){
            System.out.print("第"+(i+1)+"周:"+s6.rank[i]+" ");
        }

        try {
            liu.tax = liu.income * rate;
            liu.aftax = liu.income - liu.tax;

            zhao.tax = zhao.income * rate;
            zhao.aftax = zhao.income - zhao.tax;

            ma.tax = ma.income * rate;
            ma.aftax = ma.income - ma.tax;
        }
        catch (Exception e) {
            System.out.println("计算异常！");
        }
        System.out.println("\n\n"+liu.name+"纳税:"+liu.tax+"元");
        System.out.println(zhao.name+"纳税:"+zhao.tax+"元");
        System.out.println(ma.name+"纳税:"+ma.tax+"元");

        System.out.println("\n"+liu.name+"收入:"+liu.aftax+"元");
        System.out.println(zhao.name+"收入:"+zhao.aftax+"元");
        System.out.println(ma.name+"收入:"+ma.aftax+"元");
    }
}
